import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

// 引入element
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// 引入vant
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);

// 引入axios
import axios from 'axios'
Vue.prototype.$axios = axios

// 图片懒加载
import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad, {
  error: './static/error.png',
  loading: './static/loading.png'
})

  // 在请求头中加token
axios.interceptors.request.use(config => {

  console.log(config)

  // let a = sessionStorage.getItem('token')

  // console.log(a)

  // config.headers.Authorization = a

  // config.headers['token'] = a


  return config

})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
